package brain;

import java.util.concurrent.ArrayBlockingQueue;
import model.DrawCommand;

/**
 * @author  Owner
 */
public class DrawMemory {
    
    private String SortType;
    private ArrayBlockingQueue<DrawCommand> queue;
    
    public DrawMemory(ArrayBlockingQueue<DrawCommand> queue, String SortType) {
	this.queue = queue;
	this.SortType = SortType;
    }

    public void addToMemory(DrawCommand swapCommand){
	queue.add(swapCommand);
    }
    
    /**
	 * @return  the sortType
	 * @uml.property  name="sortType"
	 */
    public String getSortType(){
	return this.SortType;
    }
    
    public boolean isEmpty(){
	return queue.isEmpty();
    }
    
    public DrawCommand popDrawCommand() throws InterruptedException{
    	return queue.take();
    }
}
